
#include "api/scoped_refptr.h"
#include "modules/video_capture/ohos/video_capture_ohos.h"
#include "modules/video_capture/ohos/device_info_ohos.h"

namespace webrtc {
namespace videocapturemodule {

// static
VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo() {
  return DeviceInfoOhos::Create();
}

VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo(
    VideoCaptureOptions* options) {
  return DeviceInfoOhos::Create();
}


rtc::scoped_refptr<VideoCaptureModule> VideoCaptureImpl::Create(
    const char* device_id) {
  if (device_id == nullptr)
    return nullptr;

  // TODO(tommi): Use Media Foundation implementation for Vista and up.
  auto capture = rtc::make_ref_counted<VideoCaptureOhos>();
  if (capture->Init(device_id) != 0) {
    return nullptr;
  }

  return capture;
}

rtc::scoped_refptr<VideoCaptureModule> VideoCaptureImpl::Create(
    VideoCaptureOptions* options,
    const char* device_id) {
    return VideoCaptureImpl::Create(device_id);
}

}  // namespace videocapturemodule
}  // namespace webrtc